package com.study.lihan.springmvc.bean;

import com.study.lihan.springmvc.mapper.ZiThreadMapper;

import java.util.concurrent.Callable;

public class TaskThread implements Callable<String> {
    private ZiThreadMapper ziThreadMapper;
    public TaskThread(ZiThreadMapper ziThreadMapper){
        this.ziThreadMapper = ziThreadMapper;
    }
    public String call() {
        ziThreadMapper.updateById(1,"zi");
        System.out.println("子线程执行成功");
        throw new MyException("call()执行过程中抛出异常：" + Thread.currentThread().getName());
    }
}

